//
//  JShopCarBtn.m
//  HeadIndustry
//
//  Created by jun on 2017/8/29.
//  Copyright © 2017年 jun. All rights reserved.
//

#import "JShopCarBtn.h"

@implementation JShopCarBtn

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setImage:[UIImage imageNamed:@"shopcar_w"] forState:UIControlStateNormal];
        self.backgroundColor = kRGBColor(246, 175, 178);
        self.layer.cornerRadius = self.width/2.0;
        [self configUI];
    }
    return self;
}

- (void)configUI
{
    _numberLabel = [YYLabel new];
    _numberLabel.layer.cornerRadius = 8;
    _numberLabel.clipsToBounds = YES;
    _numberLabel.frame = CGRectMake(38, -4, 16, 16);
    _numberLabel.textColor = [UIColor whiteColor];
    _numberLabel.textAlignment = NSTextAlignmentCenter;
    _numberLabel.font = [UIFont systemFontOfSize:12];
    _numberLabel.backgroundColor = [UIColor redColor];
    _numberLabel.text = @"0";
    [self addSubview:_numberLabel];
    
}
- (void)setNumStr:(NSString *)numStr
{
    _numStr = numStr;
    _numberLabel.text = numStr;
}


@end
